<%@ page import="org.ikastola.FeeDetail" %>

<script>
function clearDetailForm() {
	$("#dname").val("");
	$("#dvalue").val("");
	$("#ddesc").val("");
	return true
}

function validateDetailForm() {
	var valid = true;
	var info = "&nbsp;Dato ingresado inv&aacute;lido!";
	if (!$("#dname")[0].validity.valid) {
		valid = false;
		$("#nameUpd").html(info);
	} else {
		$("#nameUpd").html("");
	}
	if (!$("#ddesc")[0].validity.valid) {
		valid = false;
		$("#descUpd").html(info);
	} else {
		$("#descUpd").html("");
	}
	if (!$("#dvalue")[0].validity.valid) {
		valid = false;
		$("#valueUpd").html(info);
	} else {
		$("#valueUpd").html("");
	}
	return valid;
}
</script>

<div class="fieldcontain ${hasErrors(bean: feeDetailInstance, field: 'name', 'error')} required">
	<label for="name">
		<g:message code="feeDetail.name.label" default="Name" />
		<span class="required-indicator">*</span>
	</label>
	<input type="text" name="dname" id="dname" value="${feeDetailInstance?.name}" required />&nbsp;<div id="nameUpd" style="color:#ff5555;display:inline;"></div>
</div>

<div class="fieldcontain ${hasErrors(bean: feeDetailInstance, field: 'value', 'error')} required">
	<label for="value">
		<g:message code="feeDetail.value.label" default="Value" />
		<span class="required-indicator">*</span>
	</label>
	<input name="dvalue" id="dvalue" type="number" step="0.05" value="${feeDetailInstance?.value}" required />&nbsp;<div id="valueUpd" style="color:#ff5555;display:inline;"></div>
</div>

<div class="fieldcontain ${hasErrors(bean: feeDetailInstance, field: 'description', 'error')} required">
	<label for="description">
		<g:message code="feeDetail.description.label" default="Description" />
		<span class="required-indicator">*</span>
	</label>
	<input type="text" name="ddesc" id="ddesc" value="${feeDetailInstance?.description}" required />&nbsp;<div id="descUpd" style="color:#ff5555;display:inline;"></div>
</div>

<%--<input type="hidden" name="parentFee.id" value="${parentId}" />--%>
